package com.sun.controller;/**
 * @author sun
 * @date 2022/1/5 - 15:43
 */

import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: TODO
 * @author 孙
 * @date 2022/1/5 15:43
 * @version 1.0
 * 操作请看https://blog.csdn.net/snail_spoor/article/details/118274781?ops_request_misc=&request_id=&biz_id=102&utm_term=SpringSecurity+Oauth2%E7%9A%84%E5%85%A5%E9%97%A8demo&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-2-118274781.pc_search_all_es&spm=1018.2226.3001.4187
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/getCurrentUser")
    public Object getCurrentUser(Authentication authentication){
        return authentication.getPrincipal();

    }
}

